﻿/****************************************************************************
** file: ToupCamCamera.h
** brief: 杭州图谱光电科技有限公司 显微镜相机支持代码
** Copyright (C) LiYuan
** Author: LiYuan
** E-Mail: 18069211#qq(.)com
** Version 0.0.1
** Last modified: 2019.07.20
** Modified By: LiYuan
****************************************************************************/

#ifndef TOUPCAM_CAMERA_H
#define TOUPCAM_CAMERA_H

///
/// 鑫图显微镜相机的支持代码。
///
#include "../CameraCommon/IndustryCameraInfo.h"
#include "../CameraCommon/IndustryCamera.h"

#include <QRect>
#include <QString>
#include <QSettings>

namespace Qly
{

class CameraTUCAM_p;


class ImageThread;

class CAMERA_EXPORT CameraTUCAM : public IndustryCamera
{
    friend ImageThread;
public:
    explicit CameraTUCAM(QObject *parent = nullptr);
    ~CameraTUCAM() Q_DECL_OVERRIDE;
    bool isLive() Q_DECL_OVERRIDE;
public slots:
    bool openDefaultCamera() Q_DECL_OVERRIDE;
    bool openCameraByID(QString id);
    bool startGrabbing() Q_DECL_OVERRIDE;
    bool stopGrabbing() Q_DECL_OVERRIDE;
    bool saveSettingsToFile(QString fileName) Q_DECL_OVERRIDE;
    bool loadSettingsFromFile(QString fileName) Q_DECL_OVERRIDE;
    void close() Q_DECL_OVERRIDE;

    bool setExposureTimeMode(AutoExposureMode mode) Q_DECL_OVERRIDE;
    bool exposureTimeMode(AutoExposureMode &mode) Q_DECL_OVERRIDE;

    bool setExposureTime(double us) Q_DECL_OVERRIDE;
    bool exposureTime(double &us) Q_DECL_OVERRIDE;
    bool exposureTimeRange(double &fMin, double &fMax, double &fValue) Q_DECL_OVERRIDE;
    bool showVCDPropertyPage() Q_DECL_OVERRIDE;

    bool frameRate(double &fps) Q_DECL_OVERRIDE;
    bool setFrameRate(double fps) Q_DECL_OVERRIDE;
private:

    CameraTUCAM_p * m_pCamera;
};

} //namespace Qly
#endif // TOUPCAM_CAMERA_H
